home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource Library: Multimedia
/
Resource Library: Multimedia.iso
/
hypercrd
/
xcmds
/
rtf-redr.hqx
/
lists.h
< prev
next >
Wrap
Text File
|
1992-12-19
|
1KB
|
43 lines
/*
* This software is copyright 1992 by Robert Morris.
* You may freely redistribute this software as shareware
* if you do so in the same form as you got it. If you find
* this software useful, please send $12 to:
* Robert Morris
* P.O. Box 1044
* Harvard Square Station
* Cambridge, MA 02238
* ecognome@aol.com
* If you incorporate any of this software in any kind of
* commercial product, please send $2 per copy distributed
* to the above address.
*/
struct list{
char **h;
long size; /* result of GetHandleSize(h) */
long ptr; /* where to read or write next */
};
#define AppendListChar(lp, c) ((lp)->ptr + 2 > (lp)->size ? \
_ALC((lp), (c)) : \
((*((lp)->h))[(lp)->ptr++] = (c), \
(*((lp)->h))[(lp)->ptr] = '\0'))
#define _AppendListChar(lp, c) ((lp)->ptr + 1 > (lp)->size ? \
_ALC((lp), (c)) : \
((*((lp)->h))[(lp)->ptr++] = (c)))
#define ReadListChar(lp) ((lp)->ptr < (lp)->size ? \
(*((lp)->h))[(lp)->ptr++] & 0xff : \
-1)
long NewList(char **, struct list *);
void FreeList(struct list *);
long PeekListLine(struct list *, char []);
long ReadListLine(struct list *, char []);
long AppendList(struct list *, char []);
long TrimList(struct list *);
void RewindListLine(struct list *);
char *item(int itm, char *in, char *out, int sep);
int _ALC(struct list *, int);